<%@ page import="News.service.UserServer" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%@ page import="javax.swing.*" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/11/29 0029
  Time: 16:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>login</title>
</head>
<body>
登录界面<br/>
<form method="post" action="Control.jsp">
    用户名：<input type="text" name="username" required><br/>
    密码：<input type="text" name="pwd" required><br/>
    <a href="Register.jsp">注册一个？</a><br/>
    <input type="submit" value="登录">
</form>
<%
    request.getSession().setAttribute("type","登录");
%>
<%
    Cookie[] cookies=request.getCookies();
    for(Cookie c:cookies){
        if(c.getName().equals("isControl")){
            if(c.getValue().equals("1")){
                response.sendRedirect("cUser.jsp");
            }else if(c.getValue().equals("0")){
                response.sendRedirect("Index.jsp");
            }else{
                response.sendRedirect("Login.jsp");
            }
        }
    }
%>
</body>
</html>
